﻿<Window x:Class="AutoUpgradeManager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Automatic Update Server Configuration Tools By:Winahriman" 
        Height="400" Width="650"  
        Style="{DynamicResource NoneBorderWindow}" 
        FocusManager.FocusedElement="{Binding ElementName=Cmb_Url}"
         WindowStartupLocation="CenterScreen" Icon="/Image/Icon.ico">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <DockPanel Grid.Column="0" Grid.Row="0" LastChildFill="True">
            <Label Margin="5,0,0,0" DockPanel.Dock="Left" VerticalAlignment="Center">服务器地址（URL）:</Label>
            <Button Margin="0,2,5,2" Width="100" Height="24" Padding="20,3" Name="BtnLink" DockPanel.Dock="Right" VerticalAlignment="Center" Click="BtnLink_Click">连接服务器</Button>
            <ComboBox Margin="5,4,5,4" TextSearch.TextPath="Attribute[Url].Value" Height="20"  SelectedValue="Attribute[Url].Value" Keyboard.PreviewKeyUp="Cmb_Url_PreviewKeyUp" Name="Cmb_Url"  DockPanel.Dock="Left"  VerticalAlignment="Center" IsEditable="True">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <DockPanel LastChildFill="True">
                            <Image DockPanel.Dock="Right" Margin="5,2,5,0" Height="12" Width="12" VerticalAlignment="Center" Source="./Image/Delete.png" MouseLeftButtonUp="Cmb_Url_ListItemDel_Event" />
                            <TextBlock DockPanel.Dock="Left"  HorizontalAlignment="Stretch" Text="{Binding Path=Attribute[Url].Value}"/>
                        </DockPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </DockPanel>
        <DockPanel Grid.Column="0" Grid.Row="1" LastChildFill="True">
            <Label DockPanel.Dock="Left" Margin="5,6,0,5" Content="升级项目名称："/>
            <Button DockPanel.Dock="Right" Name="Btn_Refresh"  Margin="5,2,5,2"  Padding="20,3" Height="24" Width="100" Click="Btn_Refresh_Click" Content="刷新列表"/>
            <Button DockPanel.Dock="Right" Name="Btn_SetProject" Margin="5,2,0,2" Padding="20,3" Height="24" Click="Btn_SetProject_Click" Content="项目配置" ToolTip="配置自动升级服务器中项目及项目升级文件路径"/>
            <Button DockPanel.Dock="Right" Name="Btn_ClearProject" Margin="5,2,0,2" Padding="20,3" Height="24" Click="Btn_ClearProject_Click" Content="文件清空" ToolTip="清空服务器项目文件夹内所有文件"/>
            <ComboBox DockPanel.Dock="Left" Name="Cmb_PrjNameList" Margin="5,4,0,4" Height="20"/>

        </DockPanel>
        <ListView AllowDrop="True"  Drop="Lvw_FileInfo_Drop" DragOver="Lvw_FileInfo_DragOver" Name="Lvw_FileInfo" Margin="5,2,5,2" Grid.Column="0" Grid.Row="2" SelectionMode="Extended">
            <ListView.View>
                <GridView AllowsColumnReorder="False">
                    <GridViewColumn DisplayMemberBinding ="{Binding Name}" Width="140" Header="文件名称"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Size}" Width="100" Header="文件大小(Byte)"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Path}" Width="180" Header="文件路径"/>
                    <GridViewColumn DisplayMemberBinding="{Binding State}" Width="60" Header="状态"/>
                </GridView>
            </ListView.View>
            
        </ListView>
        <DockPanel Grid.Column="0" Grid.Row="3" Height="40">
            <Button DockPanel.Dock="Left" Click="Btn_OpenFile_Click" Name="Btn_OpenFile" Margin="5,-1,0,0" Padding="10,3" Height="24" VerticalAlignment="Center" Content="打开项目" ToolTip="打开本地需要上传的项目文件夹"/>
            <Button DockPanel.Dock="Left" Click="Btn_ClearList_Click" Name="Btn_ClearList" Margin="5,-1,0,0" Padding="10,3" Height="24" VerticalAlignment="Center" Content="清空列表"  />
            <Button DockPanel.Dock="Left" Click="Btn_StarUpdate_Click" Name="Btn_StarUpdate" Margin="5,-1,0,0" Padding="10,3" Height="24" VerticalAlignment="Center" Content="开始上传"  />
            <Button DockPanel.Dock="Left" Click="Btn_Abore_Click" Name="Btn_Abore" Margin="5,-1,0,0" Padding="10,3" Height="24" VerticalAlignment="Center" Content="终止上传" ToolTip="终止当前正在上传的操作"/>
            <ProgressBar Name="ProgBar_UpdateOnce" Margin="5,3,5,0" Height="15" DockPanel.Dock="Top" VerticalAlignment="Top" Visibility="Hidden"/>
            <ProgressBar Name="ProgBar_Update" Margin="5,3,5,0" Height="15" DockPanel.Dock="Top" VerticalAlignment="Top" Visibility="Hidden"/>
            <!--<TextBlock Name="Txt_UpdateInfo" Margin="5,2,5,0" Foreground="{DynamicResource TextBrush}" TextTrimming="CharacterEllipsis" DockPanel.Dock="Top" VerticalAlignment="Top" Visibility="Hidden" />-->
        </DockPanel>
    </Grid>
</Window>
